package com.supermap.application.entity;

import org.hibernate.annotations.GenericGenerator;

import javax.persistence.*;
import java.text.SimpleDateFormat;
import java.util.Date;

/**
 * 行业类型表
 * Created by Administrator on 2018-01-02.
 */
@Entity
@Table(name = "T_INDUSTRY_TYPE")
public class TIndustryType {

    //主键
    private String id;
    //数据版本
    private String version;
    //行业编号
    private String A00011;
    //上游行业编号
    private String S00001;
    //下游行业编号
    private String S00002;
    //预留字段
    private String flag_a;
    private String flag_b;
    private String flag_c;

    public TIndustryType() {}

    public TIndustryType(String id, String version, String a00011, String s00001, String s00002, String flag_a, String flag_b, String flag_c) {
        this.id = id;
        this.version = version;
        A00011 = a00011;
        S00001 = s00001;
        S00002 = s00002;
        this.flag_a = flag_a;
        this.flag_b = flag_b;
        this.flag_c = flag_c;
    }

    @GenericGenerator(name = "generator", strategy = "increment")
    @Id
    @GeneratedValue(generator = "generator")
    @Column(name = "ID", unique = true, nullable = false, precision = 10, scale = 0)
    public String getId() {
        return id;
    }

    public void setId(String id) {
        this.id = id;
    }

    @Column(name="VERSION", length=100)
    public String getVersion() {
        return this.version == null ? new SimpleDateFormat("yyyy-MM-dd HH:mm:ss").format(new Date()) : this.version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    @Column(name = "A00011", length = 100)
    public String getA00011() {
        return A00011;
    }

    public void setA00011(String a00011) {
        A00011 = a00011;
    }

    @Column(name = "S00001", length = 100)
    public String getS00001() {
        return S00001;
    }

    public void setS00001(String s00001) {
        S00001 = s00001;
    }

    @Column(name = "S00002", length = 100)
    public String getS00002() {
        return S00002;
    }

    public void setS00002(String s00002) {
        S00002 = s00002;
    }

    @Column(name = "flag_a", length = 100)
    public String getFlag_a() {
        return flag_a;
    }

    public void setFlag_a(String flag_a) {
        this.flag_a = flag_a;
    }

    @Column(name = "flag_b", length = 100)
    public String getFlag_b() {
        return flag_b;
    }

    public void setFlag_b(String flag_b) {
        this.flag_b = flag_b;
    }

    @Column(name = "flag_c", length = 100)
    public String getFlag_c() {
        return flag_c;
    }

    public void setFlag_c(String flag_c) {
        this.flag_c = flag_c;
    }
}
